import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component:()=>import('../views/Home.vue')
  },
  {
    path: '/one',
    name: 'one',
    component:()=>import('../components/one.vue')
  },
  {
    path: '/admin',
    name: 'admin',
    component:()=>import('../components/admin.vue')
  },
  {
    path: '/admin_edit',
    name: 'admin_edit',
    component:()=>import('../components/admin_edit.vue')
  },
  {
    path: '/admin_add',
    name: 'admin_add',
    component:()=>import('../components/admin_add.vue')
  },
  {
    path: '/login',
    name: 'login',
    component:()=>import('../views/Login.vue')
  },
  {
    path: '/login2',
    name: 'login2',
    component:()=>import('../views/Login2.vue')
  },
  {
    path: '/register',
    name: 'register',
    component:()=>import('../views/register.vue')
  },
  {
    path: '/detail',
    name: 'detail',
    component:()=>import('../views/GoodDetail.vue')
  },
  {
    path: '/brands1',
    name: 'brands1',
    component:()=>import('../views/brands1.vue')
  },
  {
    path: '/cart',
    name: 'cart',
    //配置路由元信息
    meta:{
      // 设置需要访问权限
      requiresAuth:true
    },
    component:()=>import('../views/Cart.vue')
  },
  {
    path: '/account',
    name: 'account',
    component:()=>import('../components/account.vue')
  },
  {
    path: '/pay',
    name: 'pay',
    component:()=>import('../components/pay.vue')
  },
  {
    path: '/noclear',
    name: 'noclear',
    component:()=>import('../components/noclear.vue')
  },
  {
    path: '/admin_goshipments',
    name: 'admin_goshipments',
    component:()=>import('../components/admin_goshipments.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})


export default router
